﻿@model QLGT_2.Models.tbl_GiaoTrinh

@{
    ViewBag.Title = "Tìm kiếm Giáo trình";
    AjaxOptions aj = new AjaxOptions
    {
        InsertionMode = InsertionMode.Replace,
        UpdateTargetId = "ketquaGiaoTrinh",
        LoadingElementId = "loading-icon",
        OnFailure = "AjaxFailure",
        OnBegin = "AjaxBegin",
        OnComplete = "AjaxComplete"
    };
}

@using (Ajax.BeginForm(aj))
{
    @Html.AntiForgeryToken()
    <header class="panel-heading">
        <h3 style="text-align: center; font-weight: bold">Tìm kiếm Giáo Trình</h3>
    </header>
    <div class="panel-body">
        <div class="form-horizontal">
            <div class="row">
                <div class="col-lg-6">
                    <strong class="col-xs-4">
                        Mã Giáo trình:
                    </strong>
                    <strong class="col-xs-8">
                        @Html.TextBoxFor(m => m.MaGiaoTrinh, new { @class = "form-control", data_val = "false" })
                    </strong>
                </div>
                <div class="col-lg-6">
                    <strong class="col-xs-4">
                        Tên Giáo trình:
                    </strong>
                    <strong class="col-xs-8">
                        @Html.TextBoxFor(m => m.TenGiaoTrinh, new { @class = "form-control", data_val = "false" })
                    </strong>
                </div>
            </div>
            <div class="row">
                <div class="col-lg-6">
                    <strong class="col-xs-4">
                        Tác giả:
                    </strong>
                    <strong class="col-xs-8">
                        @Html.TextBox("txtTacGia", "", new { @class = "form-control", data_val = "false" })
                    </strong>
                </div>
                <div class="col-lg-6">
                    <strong class="col-xs-4">
                        Hiệu đỉnh:
                    </strong>
                    <strong class="col-sm-2">
                        @Html.TextBox("txtThang", "", new { @class = "form-control", data_val = "false" })
                    </strong>
                    <strong class="col-sm-2">
                        @Html.TextBox("txtNgay", "", new { @class = "form-control", data_val = "false" })
                    </strong>
                    <strong class="col-sm-4">
                        @Html.TextBox("txtNam", "", new { @class = "form-control", data_val = "false" })
                    </strong>
                </div>
            </div>
            <div class="row">
                <div class="col-lg-6">
                    <strong class="col-xs-4">
                        Nhà xuất bản:
                    </strong>
                    <strong class="col-xs-8">
                        @Html.TextBox("txtNhaXuatBan", "", new { @class = "form-control", data_val = "false" })
                    </strong>
                </div>
                <div class="col-lg-6">
                    <strong class="col-xs-4"></strong>
                    <strong class="col-xs-8"></strong>
                </div>
            </div>
            <br />
            <div class="row">
                <div style="text-align:center">
                    <input type="submit" value="Tìm kiếm" class="btn btn-danger" id="btTimKiem" />
                    <input type="button" value="Xóa" class="btn btn-danger" id="btXoa" />
                </div>
            </div>
            <br />
        </div>
    </div>
}
@*<div id="grid"></div>*@
<div id="ketquaGiaoTrinh"></div>

<script>
    $('#btXoa').click(function () {
        $('#txtNgay').val("");
        $('#txtThang').val("");
        $('#txtNam').val("");
        $('#MaGiaoTrinh').val("");
        $('#TenGiaoTrinh').val("");
        $('#txtTacGia').val("");
        $('#txtNhaXuatBan').val("");
    });
</script>